package com.smile.data.entity

import com.baomidou.mybatisplus.annotation.*
import com.fasterxml.jackson.annotation.JsonFormat
import lombok.AllArgsConstructor
import lombok.Data
import lombok.NoArgsConstructor
import java.time.LocalDateTime

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("smile_product_items")
open class ProductItemEntity {
    @TableId(type = IdType.ASSIGN_ID)
    var id: String? = null

     var menu: String? = null

    var code: String? = null

    var title: String? = null

    var description: String? = null

    @TableField("coverUrl")
    var coverUrl: String? = null

    var price: Int? = null

    @TableField("stockTotal")
    var stockTotal: Int? = null

    var status: String? = null

    var sort: String? = null

    @TableField(value = "createdAt", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    var createdAt: LocalDateTime? = null

    @TableField(value = "updatedAt", fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    var updatedAt: LocalDateTime? = null
}
